<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> 
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib tagdir="/WEB-INF/tags" prefix="tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>酒店订单列表</title>
	<link href="/res/css/style.css" rel="stylesheet" type="text/css" />
	<link href="/res/js/lib/layer/skin/layer.css" rel="stylesheet" type="text/css" />
	<link href="/res/js/lib/layer/skin/layer.ext.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="/res/js/jquery.js"></script>
	<script type="text/javascript" src="/res/js/lib/json2.js"></script>	
	<script type="text/javascript" src="/res/js/lib/layer/layer.js"></script>
	<script type="text/javascript" src="/res/js/common/msgTools.js"></script>
	<script language="javascript" type="text/javascript" src="/res/js/lib/datePicker/WdatePicker.js"></script>		
 	<script type="text/javascript" src="/res/js/pages/system/adminList.js"></script>
</head>
<body>
	<div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="#">首页</a></li>
    <li><a href="#">酒店管理</a></li>
    <li><a href="#">酒店订单列表</a></li>
    </ul>
    </div>
    
    <div class="rightinfo">
    <form id="queryForm" action='/hotel/order/list/${!QUERY?"":"?__query__"}' method="post"> 
    <div class="tools" style="margin:3px 0px;padding:6px 0px;">  
    	<span class="toolbar" style="margin-left:10px;">
		   酒店名称
 			   <select class="dfinput"  name="hotelId" style="width:100px;" onchange="submit()">
 			   	<option value="" ${!empty(dto)&&!empty(dto.hotelId)?"":"selected"}>---全部---</option>
 			   	<c:forEach items="${hotels}" var="row" varStatus="status">
 			   		<option value="${row.id}" ${!empty(dto) && dto.hotelId=="${row.id}"?"selected":""}>${row.merchant_name}</option>
 			   	</c:forEach>
			   </select>  
                       订单状态
 			   <select class="dfinput"  name="status" style="width:100px;" onchange="submit()">
 			    <option value="" ${!empty(dto) && !empty(dto.status)?"":"selected"}>---全部---</option>
				<option value="0" ${!empty(dto) && dto.status==0?"selected":""}>未处理</option>
				<option value="1" ${!empty(dto) && dto.status==1?"selected":""}>已确认</option>
				<option value="2" ${!empty(dto) && dto.status==2?"selected":""}>退款中</option>
				<option value="3" ${!empty(dto) && dto.status==3?"selected":""}>已结束</option>
				<option value="4" ${!empty(dto) && dto.status==4?"selected":""}>已退款</option>
			   </select> 
		 支付状态
 			   <select class="dfinput"  name="isPaid" style="width:100px;" onchange="submit()">
 			    <option value="" ${!empty(dto) && !empty(dto.isPaid)?"":"selected"}>---全部---</option>
				<option value="0" ${!empty(dto) && dto.isPaid==0?"selected":""}>未支付</option>
				<option value="1" ${!empty(dto) && dto.isPaid==1?"selected":""}>已支付</option>
				<option value="2" ${!empty(dto) && dto.isPaid==2?"selected":""}>已退款</option>
			   </select> 
                       订单编号：<input name="orderNum" value="${dto.orderNum}" type="text" class="dfinput" style="width:100px;"/>
                       入住日期：<input id="d12" name="inTimeMin" value="${dto.inTimeMin}" type="text" class="dfinput" style="width:100px;" onClick="WdatePicker()"/>
              <img onclick="WdatePicker({el:'d12'})" src="/res/js/lib/datePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">至
              <input id="d13" name="inTimeMax" value="${dto.inTimeMax}" type="text" class="dfinput" style="width:100px;" onClick="WdatePicker()"/>
              <img onclick="WdatePicker({el:'d13'})" src="/res/js/lib/datePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">             
        </span>
	    <ul class="toolbar" style="margin-left:20px;">
	        <li onclick="$('#queryForm').submit()"><span><img src="/res/images/ico06.png" /></span>搜索</li>
        </ul> 
    </div> 
	</form>
    <table class="tablelist">
    	<thead>
	    	<tr>
	        <th class="chk"><input id="chkAll" type="checkbox" value="" /></th>
	        <th>编号</th>
			<th>酒店名称</th>
			<th>订单编号</th>
			<th>订单金额</th>
			<th>类型</th>
			<th>订单状态</th>
			<th>支付状态</th>
			<th>房型名称</th>
			<th>客人姓名</th>
			<th>入住日期</th>
			<th>离店日期</th>
			<th>房间数</th>
			<th>操作</th>
	        </tr>
        </thead>
        <tbody>        
	        <c:forEach items="${list}" var="row" varStatus="status">
		        <tr>
		        <td align="center"><input id="chk_${row.id}" type="checkbox" value="${row.id}" /></td>
		        <td>${status.index+1}</td>
		        <td>${row.merchant_name}</td>
	            <td>${row.order_num}</td>
	            <td style="color:#FF9900;">${row.ammount}</td>
	            <td>${row.is_first==1?"新定":"非新定"}</td>
	            <td style="color:#0099FF;">
	            	<c:choose>
	            	   <c:when test='${row.status=="0"}'>未处理</c:when>
		               <c:when test='${row.status=="1"}'>已确认</c:when>
		               <c:when test='${row.status=="2"}'>退款中</c:when>
		               <c:when test='${row.status=="3"}'>已结束</c:when>
		               <c:when test='${row.status=="4"}'>已拒绝</c:when>
		            </c:choose>		
	            </td>
	            <td style="color:#0099FF;">
	            	<c:choose>
	            	   <c:when test='${row.is_paid=="0"}'>未支付</c:when>
		               <c:when test='${row.is_paid=="1"}'>已支付</c:when>
		               <c:when test='${row.is_paid=="2"}'>已退款</c:when>
		            </c:choose>		
	            </td>
	            <td>${row.name}</td>
	            <td>${row.real_name}</td>
	            <td>${row.in_time}</td>
	            <td>${row.out_time}</td>
	            <td>${row.num}</td>
	            <td><a href="" class="tablelink">查看</a></td>
		        </tr> 
	        </c:forEach>
         </tbody>
    </table>   
    </form>
      
    <tags:pager pagerRange="10" pageSize="${pager.pageSize}" totalPage="${pager.pageCount}" curIndex="${pager.pageIndex}" rowCount="${pager.rowCount}" formId="queryForm"></tags:pager> 
 
    
    </div>
    
    <script type="text/javascript">
	   $('.tablelist tbody tr:odd').addClass('odd');
	</script>

</body>

</html>
